// 引用网络请求中间件
import request from '../../utils/request.js';







export function selectUserOwnGroupList(data) {
	return request({
		url: `/api/group/selectUserOwnGroupList`,
		method: 'GET'
	})
}

export function selectUserOwnUnGroupDeviceList(data) {
	return request({
		url: `/api/group/selectUserOwnUnGroupDeviceList`,
		method: 'GET'
	})
}




export function addGroup(data) {
	return request({
		url: `/api/group/addGroup`,
		method: 'POST',
		data
	})
}


export function editGroup(data) {
	return request({
		url: `/api/group/editGroup`,
		method: 'PUT',
		data
	})
}

export function removeGroup(groupId) {
	return request({
		url: `/api/group/removeGroup/${groupId}`,
		method: 'DELETE',
	})
}

export function saveGroupDevice(groupId, deviceIds) {
	return request({
		url: `/api/group/saveGroupDevice/${groupId}/${deviceIds}`,
		method: 'POST',
	})
}

export function selectOwnUserDeviceByGroupId(data) {
	let {
		groupId,
		pageNum = 1,
		pageSize = 999
	} = data
	return request({
		url: `/api/group/selectOwnUserDeviceByGroupId?groupId=${groupId}&pageNum=${pageNum}&pageSize=${pageSize}`,
		method: 'POST',
	})
	// return request({
	// 	url: `/api/group/selectOwnUserDeviceByGroupId`,
	// 	method: 'POST',
	// 	data
	// })
}